package com.chixing.day17_reflect_thread.work;

public class Producer implements Runnable{
    private PublicResource resource;
    public Producer(PublicResource resource){
        this.resource = resource;
    }
    @Override
    public void run() {
        for (int i=0;i<50;i++){
            resource.produce();//生产一个面包
        }
    }
}
